(defclass DEVICE (is-a USER) (role abstract)
    (slot ID     (visibility public) (type SYMBOL))
    (slot Class  (visibility public) (type SYMBOL) (access initialize-only))
    (slot Parent (visibility public) (default-dynamic nil))
    (slot UUID   (visibility public) (type STRING))
    (slot insCnt (type INTEGER) (storage shared) (default 0))
)

(defmessage-handler DEVICE init after ()
    (bind ?self:ID (instance-name-to-symbol (instance-name ?self)))
    (bind ?self:Class (class ?self))
    (bind ?self:insCnt (+ ?self:insCnt 1))
)

(defclass Light2 (is-a DEVICE) (role concrete) (pattern-match reactive)
  (slot switch (type INTEGER) (allowed-integers 0 1) )
  (slot temprature (type FLOAT) (range -15.0 95.0))
  (slot color (type STRING) (allowed-strings "red" "green" "blue") )
)

(list-defclasses)
(undefclass Light2)
(list-defclasses)
(exit)
